package net.cyndeline.scalarlib.rldungeon.dgs

import net.cyndeline.scalarlib.rldungeon.dgs.graph.{DGSFunctionality, Room}
import scalax.collection.immutable.Graph
import scalax.collection.GraphEdge.UnDiEdge
import scalax.collection.GraphPredef.OuterEdge

/**
 * Processes an edge and a room by adding a responder to the edge, and an accompanying activator to the room.
 */
trait ActivatorResponderProcessor[VType <: Room[VType], EType[X] <: UnDiEdge[X] with DGSFunctionality[X, EType] with OuterEdge[X, EType]] {

  /**
   * Adds an activator to a room and a matching responder to an edge,
   * @param room Room to add activator to.
   * @param edge Corridor edge to add responder to.
   * @param graph Graph that the room and edge belongs to.
   * @return A room/edge tuple that has been updated with an activator/responder. The edge should still point to its
   *         original vertices, and not to the updated vertex returned in the tuple.
   */
  def createActivatorResponder(room: VType, edge: EType[VType], graph: Graph[VType, EType]): (VType, EType[VType])

}
